package com.iengoo.inductionms.ctrl.rest;

import com.iengoo.inductionms.entity.EducationExperience;
import com.iengoo.inductionms.service.EducationExperienceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zpym
 * @CopyRight (C) http://www.iengoo.com
 * @brief
 * @email 122162005@qq.com
 * @date 2019-03-26 12:44
 */
@RestController
@RequestMapping("/edu/exp")
public class EducationExperienceController {
    @Autowired
    private EducationExperienceService service;

    @PostMapping
    public void insert(@RequestBody EducationExperience record) {
        service.insertSelective(record);
    }
    //查询所以学历信息
    @GetMapping
    public List<EducationExperience> queryAll(int userId) {
        return service.queryAll(userId);
    }

    @GetMapping("/{id}")
    public EducationExperience findById(@PathVariable int id) {
        return service.findById(id);
    }

    @PutMapping("/{id}")
    public void update(@RequestBody EducationExperience e, @PathVariable int id) {
        service.update(e);
    }
}
